/* 扫码容器 */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

/* 导航栏 */
.navbar {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-bottom: none;
    position: relative;
    z-index: 100;
}

/* 扫描器容器 */
.scannerContainer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 视频元素 */
.video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 覆盖层 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

/* 扫描框 */
.scanBox {
    width: 250px;
    height: 250px;
    position: relative;
    margin-bottom: 40px;
}

/* 扫描框四角 */
.corners {
    position: absolute;
    width: 100%;
    height: 100%;
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #00ff00;
}

.topLeft {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.topRight {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.bottomLeft {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.bottomRight {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* 扫描线 */
.scanLine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    animation: scanAnimation 2s linear infinite;
}

@keyframes scanAnimation {
    0% {
        top: 0;
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* 提示文字 */
.tipText {
    color: white;
    font-size: 16px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 无摄像头状态 */
.noCamera {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.noCameraIcon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.noCameraText {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.noCameraSubtext {
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.5;
}

/* 控制按钮区域 */
.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    min-height: 100px;
}

.controlBtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 12px;
    transition: all 0.3s ease;
}

.controlBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.controlBtn span {
    margin-top: 4px;
    font-size: 11px;
}

.flashOn {
    background: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
    color: #ffc107;
}

/* 扫描结果卡片 */
.resultCard {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0;
    margin: 16px 0;
    overflow: hidden;
}

.resultHeader {
    display: flex;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.resultIcon {
    font-size: 24px;
    margin-right: 12px;
}

.resultType {
    font-size: 16px;
    font-weight: 500;
}

.resultContent {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-all;
    background: white;
    color: #333;
    max-height: 120px;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .scanBox {
        width: 200px;
        height: 200px;
    }

    .controls {
        padding: 15px;
        min-height: 80px;
    }

    .controlBtn {
        width: 60px;
        height: 60px;
        font-size: 11px;
    }

    .controlBtn span {
        font-size: 10px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .scanBox {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }

    .tipText {
        font-size: 14px;
    }

    .controls {
        padding: 10px;
        min-height: 60px;
    }

    .controlBtn {
        width: 50px;
        height: 50px;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .resultCard {
        background: #2d2d2d;
    }

    .resultContent {
        background: #1a1a1a;
        color: #e5e5e5;
    }
}

/* 扫描框呼吸效果 */
.scanBox::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
}

.loadingSpinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}